<div class="page-wrapper d-flex flex-column pt-4">
    <div class="container-xl">
        <div class="page-header d-print-none">
            <div class="row align-items-center">
                <div class="col">
                    <div class="page-pretitle">
                        Create
                    </div>
                    <h3 class="page-title">
                        New User
                    </h3>
                </div>
            </div>
        </div>
    </div>
    <div class="page-body d-flex flex-row-reverse">
        <aside class="bd-sidebar sub-sidebar">
            <nav class="bd-links p-3" aria-label="Sub-section navigation">
                <div class="card card-body">
                    <!-- <actions preview-url="activedUser.fullPath" back-url="'/portal/user/list'"></actions> -->

                    <div class="btn-group w-100 mb-4" role="group">
                        <button id="btnToSubmit" type="button" ng-click="register(activedUser)"
                            class="btn btn-primary text-white">
                            <i class="fa fa-save"></i>
                            <span ng-bind="translate('Save')"></span>
                        </button>
                    </div>
                    <custom-image header="'Avatar'" type="'Users'" folder="'Avatars'" src-url="activedUser.avatarUrl"
                        src="activedUser.avatar" posted-file="activedUser.mediaFile">
                    </custom-image>
                </div>
            </nav>
        </aside>

        <!-- ----------------------------------------------------------- -->

        <div class="content-body py-3 pe-3">
            <!-- Main content -->
            <section class="" ng-init="loadUser()">
                <div class="card mb-5">
                    <div class="card-body">
                        <form ng-if="activedUser" ng-class="{'submitted': submitted}" ng-submit="register(activedUser)">
                            <div class="row">
                                <div class="mb-3 col">
                                    <label class="form-label">First Name</label>
                                    <input type="text" class="form-control" ng-model="activedUser.firstName" />
                                </div>
                                <div class="mb-3 col">
                                    <label class="form-label">Last Name</label>
                                    <input type="text" class="form-control tags" ng-model="activedUser.lastName" />
                                </div>
                            </div>
                            <div class="row">
                                <div class="mb-3 col">
                                    <label class="form-label">Username</label>
                                    <input type="text" required class="form-control" ng-model="activedUser.username" />
                                </div>
                                <div class="mb-3 col">
                                    <label class="form-label">Email</label>
                                    <input type="email" required class="form-control" ng-model="activedUser.email" />
                                </div>
                            </div>
                            <div class="row">
                                <div class="mb-3 col">
                                    <label class="form-label">Password</label>
                                    <input type="password" required class="form-control"
                                        ng-model="activedUser.password" />
                                </div>
                                <div class="mb-3 col">
                                    <label class="form-label">Confirm Password</label>
                                    <input type="password" class="form-control" required
                                        ng-model="activedUser.confirmPassword" />
                                </div>
                            </div>
                            <div ng-if="isAdmin && activedUser.id" class="tab-pane"
                                ng-if="activedUser.userRoles.length>0">
                                <label ng-if="isAdmin" class="form-label">Active roles</label>
                                <navs data="activedUser.userRoles" callback="updateRoleStatus(nav)"></navs>
                            </div>
                        </form>
                    </div>
                </div>
            </section>
            <!-- /.content -->
        </div>

    </div>
</div>